<% include("/common/splitPage.html"){} %>

<form id="splitPage" class="form-horizontal" action="${cxt!}/jf/wx/user" method="POST">
	
	<div>
		<ul class="breadcrumb">
			<li>
				<a href="#" onclick="ajaxContent('/jf/wx/index/content');">主页</a> <span class="divider">/</span>
			</li>
			<li>
				<a href="#">用户管理</a>
			</li>
		</ul>
	</div>
	
	<div class="row-fluid sortable">
		<div class="box span12">
			<div class="box-header well" data-original-title>
				<h2><i class="icon-edit"></i> 用户查询</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-down"></i></a>
					<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
				</div>
			</div>
			<div class="box-content" style="display: none;">
				<fieldset>
				  	<div class="control-group">
						<label class="control-label">用户的标识</label>
						<div class="controls">
					  		<input class="input-xlarge" type="text" name="_query.openid" value='${escapeXml(paramMap["_query.openid"])}' maxlength="40" >
						</div>
				  	</div>
				
				  	<div class="control-group">
						<label class="control-label" for="focusedInput">昵称</label>
						<div class="controls">
					  		<input class="input-xlarge focused" type="text" name="_query.nickname" value='${escapeXml(paramMap["_query.nickname"])}' maxlength="20" >
						</div>
				  	</div>
				  
				  	<div class="form-actions">
						<button type="button" class="btn btn-primary" onclick='ajaxForm("splitPage");'>查询</button>
						<button type="reset" class="btn">清除</button>
				  	</div>
				</fieldset>
			</div>
		</div><!--/span-->
	</div><!--/row-->
	
	<div class="row-fluid sortable">
		<div class="box span12">
			
			<div class="box-header well" data-original-title>
				<h2><i class="icon-user"></i> 用户列表</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a> 
					<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
				</div>
			</div>
			
			<div class="box-content">
				<table class="table table-striped table-bordered bootstrap-datatable ">
					<thead>
						<tr>
							<th onclick="orderbyFun('openid')">
								用户标识${orderBy("openid", splitPage.orderColunm, splitPage.orderMode)}
	      					</th>
							<th onclick="orderbyFun('subscribe')">
								关注状态${orderBy("subscribe", splitPage.orderColunm, splitPage.orderMode)}
	      					</th>
							<th onclick="orderbyFun('subscribetime')">
								关注时间${orderBy("subscribetime", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('nickname')">
								昵称${orderBy("nickname", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('sex')">
								性别${orderBy("sex", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('country')">
								国家${orderBy("country", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('province')">
								省份${orderBy("province", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('city')">
								城市${orderBy("city", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('language')">
								语言${orderBy("language", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th onclick="orderbyFun('headimgurl')">
								头像url${orderBy("headimgurl", splitPage.orderColunm, splitPage.orderMode)}
							</th>
							<th width="160">操作</th>
						</tr>
					</thead>
					<tbody>
						<%
							var userMessage = hasPrivilegeUrl("/jf/wx/message/userMessage", reqSysLog.userids);
						%>
						<% for(user in splitPage.page.list){ %>
							<tr>
								<td>${user.openid }</td>
								<td>${user["subscribe"] == "1" ? "关注" : "未关注" }</td>
								<td class="center">${user["subscribetime"] }</td>
								<td class="center">${user["nickname"] }</td>
								<td class="center">
									<%if(user["sex"] == "0"){%>
										<span class="label label-success">未知</span>
									<%}else if(user["sex"] == "1"){%>
										<span class="label label-success">男</span>
									<%}else if(user["sex"] == "2"){%>
										<span class="label label-success">女</span>
									<%}%>
								</td>
								<td class="center">${user["country"] }</td>
								<td class="center">${user["province"] }</td>
								<td class="center">${user["city"] }</td>
								<td class="center">${user["language"] }</td>
								<td class="center">${user["headimgurl"] }</td>
								<td class="center">
									<% if(userMessage == true){ %>
										<a class="btn btn-success" href="#" onclick="ajaxContent('/jf/wx/message/userMessage/${user.ids!}');"> <i class="icon-zoom-in icon-white"></i> 查看</a>
									<% } %>
								</td>
							</tr>
						<% } %>
					</tbody>
				</table>
				<div id="splitPageDiv" class="pagination pagination-centered"></div>
			</div>
			
		</div>
		<!--/span-->
	
	</div>
	<!--/row-->

</form>